<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>trimStart与trimEnd</title>
</head>

<body>
    <script>
        //清除空格
        let str = '    我爱你你爱我，蜜雪冰城甜蜜蜜      ';
        console.log(str);
        console.log(str.trimStart());
        console.log(str.trimEnd());

    </script>
</body>

</html>